package io.renren.controller;

import io.renren.common.utils.R;
import io.renren.service.StationService;
import io.renren.vo.StationRespVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.cors.CorsConfiguration;

import java.util.List;

@RestController
@RequestMapping("/api")
@Api(tags="站点接口")
public class ApiStationController {

    @Autowired
    private StationService stationService;

    @GetMapping("list-stations")
    @ApiOperation("获取站点列表")
    @CrossOrigin(CorsConfiguration.ALL)
    public R list(){
        List<StationRespVo> result = stationService.listStations();

        return R.ok().put("data", result);
    }
}
